# 继承
class Person:
    def eat(self):
        print("吃饭的方法", self)

    def sing(self):
        print("唱歌的方法", self)


# 单继承
class Girl(Person):
    pass  # 占位符


class Boy(Person):
    pass


girl = Girl()
girl.eat()
girl.sing()
boy = Boy()
boy.eat()
boy.sing()


#
class Father:
    def eat(self):
        print("吃饭", self)

    def sleep(self):
        print("睡觉", self)


class Son(Father):
    pass


class GrandSon(Son):
    pass


son = Son()
son.eat()
son.sleep()
grandSon = GrandSon()
grandSon.eat()
grandSon.sleep()


class Person:
    def money(self):
        print("继承100万", self)


class Man(Person):
    def money(self):
        # Person.money(self)
        super().money()
        print("自己赚了1000万", self)


man = Man()
man.money()


class Animal:
    def walk(self):
        print("走路", self)


class Dog(Animal):
    name = '小黑'

    def bite(self):
        print("咬人", self)


# 多继承
class Father(object):
    def momey(self):
        print("继承100万", self)


class Mother(object):
    def momey(self):
        print("继承120万", self)

    def appearance(self):
        print("美貌被继承", self)


class Son(Father, Mother):
    pass


son = Son()
son.momey()
son.appearance()
# 同名方法 就近原则
print(Son.__mro__)
